<?php

namespace Database\Seeders;

use App\Models\Examination;
use Illuminate\Database\Seeder;

class ExaminationSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $examinations = [
            ['user_id' => 2, 'name' => '小白的考试1', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 1, 'status' => 1],
            ['user_id' => 2, 'name' => '小白的考试2', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 2, 'status' => 1],
            ['user_id' => 2, 'name' => '小白的考试3', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 3, 'status' => 1],
            ['user_id' => 2, 'name' => '小白的考试4', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 1, 'status' => 1],
            ['user_id' => 2, 'name' => '小白的考试5', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 2, 'status' => 1],
            ['user_id' => 2, 'name' => '小白的考试6', 'category_id' => rand(11, 16), 'subject_id' => rand(1, 3), 'type' => rand(1, 3), 'peoples' => ',1,2,3,', 'reviewer' => '1', 'start_time' => date('Y-m-d H:i:s', time() - 900), 'over_time' => date('Y-m-d H:i:s', time() + 900), 'timer' => 7200, 'test_list_id' => 3, 'status' => 1],
        ];

        foreach ($examinations as $examination) {
            Examination::create($examination);
        }
    }
}
